import httpRequest from '@/utils/request.js'

// 获取新闻资讯列表
export function getPressListByKeywords(key = null) {
	if (key) {
		return httpRequest.get('/prod-api/press/press/list', `title=${encodeURIComponent(key)}`);
	} else {
		return httpRequest.get('/prod-api/press/press/list');
	}
}
export function getPressListByType(type) {
	return httpRequest.get('/prod-api/press/press/list', `type=${type}`);
}

// 获取新闻详情
export function getPressDetail(id) {
	return httpRequest.get(`/prod-api/press/press/${id}`);
}

// 获取广告轮播列表
export function getRotationList() {
	return httpRequest.get('/prod-api/api/rotation/list');
}

// 获取系统全部服务
export function getServiceList() {
	return httpRequest.get('/prod-api/api/service/list');
}

// 获取地理位置
// 当前位置
export function getLocation() {
	return httpRequest.get('/prod-api/api/common/gps/location');
}
// 省份列表
export function getProvinces() {
	return httpRequest.get('/prod-api/api/common/gps/province');
}
// 城市列表
export function getCities(provinceName) {
	return httpRequest.get(`/prod-api/api/common/gps/city?provinceName=${encodeURIComponent(provinceName)}`);
}

// 获取当前天气
export function getWeather() {
	return httpRequest.get('/prod-api/api/common/weather/today')
}